﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using AFT.Parking.Entity;

namespace AFT.Parking.WebSite.Controllers
{
    public class BaseController : Controller
    {
        private const string _account="Customer";
        /// <summary>
        /// 是否登录（true：已登录；反之。）
        /// </summary>
        public bool IsLogin
        {
            get { return (Session[_account] as Customer) != null; }
        }
        /// <summary>
        /// 获取已登录用户信息
        /// </summary>
        public Customer Customer
        {
            get
            {
                return Session[_account] as Customer;
            }
        }
        /// <summary>
        /// 更新会话信息
        /// </summary>
        public void UpdateUserSession(Customer customer)
        {
            Session[_account] = customer;
        }

    }
}